const http = require('http')
const url = require('url')
const server = http.createServer((req, res) => {
    console.log(req.url, 'log')
    let urlObj = url.parse(req.url, true)
    switch(urlObj.pathname) {
        case '/blog/list':
            res.end(`${urlObj.query.callback} (${JSON.stringify({
                name: 'zs',
                age: 100
            })})`)
            break;
        default: 
            res.end('404')
    }

})

server.listen('9090')
console.log('ok')